package com.wuxiaofan.auth.api;

import com.wuxiaofan.auth.vo.ReturnResult;
import java.security.Principal;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wuxiaofan
 * @date 2021/11/10 3:20 下午
 */
@RestController
@RequestMapping("auth")
@Slf4j
public class AuthApi {

    @GetMapping("code")
    public String code(String code){
        log.info("code:{}",code);
        return code;
    }

    @RequestMapping("resource")
    public Principal resource(Principal principal){
        log.info("受保护资源:{}",principal);
        return principal;
    }

}
